﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ExportToRTR.YAML.CollisionRule
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll


namespace DnProcessSimulateCommands.ExportToRTR.YAML;

public class CollisionRule : CollisionRuleBase
{
  public CollisionSet SetClearance;

  public CollisionRule()
  {
  }

  public CollisionRule(CollisionSetsBetweenBase between)
  {
    this.SetClearance = new CollisionSet(between);
  }

  public CollisionRule(CollisionRule other)
  {
    this.SetClearance = new CollisionSet((CollisionSetsBetweenBase) new CollisionSetsBetween(other.SetClearance.Between as CollisionSetsBetween));
  }

  public override bool AlmostEquals(CollisionRuleBase other, double epsilon)
  {
    if (this.GetType() == other.GetType())
    {
      CollisionRule collisionRule = (CollisionRule) other;
      if (this.SetClearance != null && collisionRule.SetClearance != null)
        return this.SetClearance.AlmostEquals(collisionRule.SetClearance, epsilon);
      if (this.SetClearance == null && collisionRule.SetClearance == null)
        return true;
    }
    return false;
  }
}
